#ifndef _OBJPOOL_H
#define _OBJPOOL_H
#include <stdlib.h>

struct obj_node {
	void *obj;
	char used;
};

struct obj_pool {
	void *datablock;
	size_t length;
	size_t unit;
	struct obj_node *obj_arr;
};

extern struct obj_pool* objpool_build(size_t unit, size_t count);
extern int objpool_release(struct obj_pool *objpool);

extern void* object_new(struct obj_pool *pool);
extern int object_del(struct obj_pool *pool, void *object);

#endif
